#!/bin/bash
if [ $# -lt 1 ]
then
    echo "za malo argumentow"
    exit -1
fi

cp $1 var.tmp

while read -r LINE
do
	name=`echo $LINE | cut -f1 -d ' '`
	value=`echo $LINE | cut -f2- -d ' '`
	# dump it to file after every substitution
	cat var.tmp | perl -i.bak -pe"s/^\s*$name=.*[;\n]?//g" && echo "$name=\"$value\"" > var.tmp
done < values.tmp
# cat after all substitutions
cat var.tmp
rm var.tmp
